<?php

namespace App\Modules\Admin\Http\Controllers\Bus;

use App\Modules\Admin\Http\Controllers\BaseController;
use App\Modules\Admin\Services\Bus\ChargeService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class BusChargeController extends BaseController
{
    public function __construct(ChargeService $service)
    {
        $this->service = $service;
    }

    public function createRecharge(Request $request): JsonResponse
    {
        $result = $this->service->createRecharge($request->all());

        return $this->successJson($result, $this->service->getError());
    }
    // 退款
    public function refundRecharge(Request $request): JsonResponse
    {
        $result = $this->service->refundRecharge($request);

        return $this->successJson($result, $this->service->getError());
    }
}
